﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class admin_AdminOrder : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindDataTable();
        }
    }
    private void bindDataTable()
    {
        DataTable dt = Exam.getAllOrderInfos();
        if (dt.Columns.Contains("OrderStateCHN"))
            dt.Columns.Remove("OrderStateCHN");
        dt.Columns.Add("OrderStateCHN");
        foreach (DataRow dr in dt.Rows)
        {
            if (dr["OrderState"].ToString().Trim() == "0")
            {
                dr["OrderStateCHN"] = "未缴费";
            }
            else if (dr["OrderState"].ToString().Trim() == "5")
            {
                dr["OrderStateCHN"] = "缴费中";
            }
            else
            {
                dr["OrderStateCHN"] = "已缴费";
            }
        }
        gv.DataSource = dt;
        gv.DataBind();
    }
}